#ifndef KERN_SLEEPLOCK_H
#define KERN_SLEEPLOCK_H

#include <kern/spinlock.h>

struct sleeplock {
	unsigned locked;       // Is the lock held?
	struct spinlock lock;
	int pid;
};

void sleep_initlock(struct sleeplock *lk);
void sleep_lock(struct sleeplock *lk);
void sleep_unlock(struct sleeplock *lk);
int sleep_holding(struct sleeplock *lk);

#endif
